
<div class="layui-form" lay-filter="back-article-form">
  <div class="layui-form-item">
   
      <label class="layui-form-label">标题</label>
      <div class="layui-input-block" style="max-width: 513px">
        <script type="text/html" template>
          <input type="hidden" name="id" value="{{ d.params.id || '' }}">
          <input type="text" name="title" value="{{ d.params.title || '' }}" lay-verify="required" placeholder="请输入标题" class="layui-input">
        </script>
      </div>
   

  </div>
  <div class="layui-form-item">
    <div class="layui-inline">
      <label class="layui-form-label">分类</label>
      <div class="layui-input-inline">
        <script type="text/html" template>
          <select name="type_id" id="back-article-form-type-select" lay-verify="required">
            
            <option value="0" {{ d.params.id ? 'disabled':'' }} >请选择</option>
            
          </select>
        </script>
      </div>
    </div>
    <div class="layui-inline">
      <label class="layui-form-label">推荐</label>
      <div class="layui-input-inline">
        <script type="text/html" template>
          <select name="hot_level">
            <option value="1" {{ d.params.hot_level == 1 ? 'selected':'' }} >普通</option>
            <option value="2" {{ d.params.hot_level == 2 ? 'selected':'' }} >推荐</option>
            <option value="3" {{ d.params.hot_level == 3 ? 'selected':'' }} >置顶</option>
          </select>
        </script>
      </div>
    </div>
  </div>
  <div class="layui-form-item">
    <div class="layui-inline">
      <label class="layui-form-label">状态</label>
      <div class="layui-input-inline">
        <script type="text/html" template>
          <input type="checkbox" lay-filter="switch" name="status" {{ d.params.status === 0 ? '' : 'checked' }} lay-skin="switch" lay-text="显示|隐藏">
        </script>
      </div>
    </div>
    <div class="layui-inline">
      <label class="layui-form-label">评论</label>
      <div class="layui-input-inline">
        <script type="text/html" template>
          <input type="checkbox" lay-filter="switch" name="comment_status" {{ d.params.comment_status === 0 ? '' : 'checked' }} lay-skin="switch" lay-text="开启|关闭">
        </script>
      </div>
    </div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">封面</label>
    <div class="layui-input-block">
      <div class="layui-upload">
        <button type="button" class="layui-btn" id="upload-cover">上传图片</button>
        <div class="layui-upload-list">
          <script type="text/html" template>
            <img class="layui-upload-img" id="upload-cover-img" src="{{ d.params.cover || '' }}" style="height: 100px;border:1px solid #e2e2e2;min-width: 100px">
            <input type="hidden" name="cover" value="{{ d.params.cover || '' }}" id="upload-cover-input">
          </script>
          <p id="upload-cover-text"></p>
        </div>
      </div> 
    </div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">内容</label>
    <div class="layui-input-block" style="max-width: 513px">
      <script type="text/html" template>
        <textarea id="myEditor" style="display: none;">
          {{ d.params.content || '' }}
        </textarea>
      </script>
    </div>
  </div>
  <div class="layui-form-item" style="text-align: center;">
    <button class="layui-btn" lay-submit lay-filter="back-article-form-submit">确认</button>
    <button class="layui-btn" type="button" id="layer-close">关闭</button>
  </div>
</div>

<script type="text/javascript">
//实例化编辑器
layui.use(['admin', 'form'], function(){
  var $ = layui.$
  ,form = layui.form
  ,setter = layui.setter
  ,admin = layui.admin;
});

</script>